<?php

/*
=====================================================
 FluxBB - Delux Board Converstations (DBC)
-----------------------------------------------------
 http://dbc-forum.com/
 http://fluxbb.org/
-----------------------------------------------------
 Copyright (c) 2010,2011 FluxBB - Delux Board Conversations (DBC)
-----------------------------------------------------
 Предсловие: Данный скрипт (DBC) не является работой с нуля, то 
 есть ядром скрипта всё также остаётся FuxBB,но теперь в оболочке
 DBC.
=====================================================
*/

if (!defined('DBC') || !defined('DBC_PMS_NEW'))
	exit;

define('DBC_PMS_LOADED', 1);

$tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
$pid = isset($_GET['pid']) ? intval($_GET['pid']) : 0;
if ($tid < 1 && $pid < 1)
	message($lang_common['Bad request']);

if ($pid)
{
	$result = $db->query('SELECT topic_id FROM '.$db->prefix.'pms_new_posts WHERE id='.$pid) or error('Unable to fetch pms_new_posts info', __FILE__, __LINE__, $db->error());
	if (!$db->num_rows($result))
		message($lang_common['Bad request']);

	$tid = $db->result($result);

	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'pms_new_posts WHERE topic_id='.$tid.' AND id<'.$pid) or error('Unable to fetch pms_new_posts info', __FILE__, __LINE__, $db->error());
	$i = $db->result($result) + 1;
	$_GET['p'] = ceil($i / $DBC_user['disp_posts']);
}
else if ($action == 'new')
{
	$result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'pms_new_posts WHERE poster_id!='.$DBC_user['id'].' AND topic_id='.$tid.' AND post_new=1') or error('Unable to fetch pms_new_posts info', __FILE__, __LINE__, $db->error());
	$first_new_post_id = $db->result($result);
	if ($first_new_post_id)
	{
		header('Location: pmsnew.php?mdl=topic&pid='.$first_new_post_id.'#p'.$first_new_post_id);
		exit;
	}
}

if (in_array($tid, $pmsn_arr_new))
	$mmodul = 'new';
else if (in_array($tid, $pmsn_arr_list))
	$mmodul = 'list';
else if (in_array($tid, $pmsn_arr_save))
	$mmodul = 'save';
else
	message($lang_common['Bad request']);

$result = $db->query('SELECT t.*, u.num_posts, u.id AS userid FROM '.$db->prefix.'pms_new_topics AS t LEFT JOIN '.$db->prefix.'users AS u ON (u.id!='.$DBC_user['id'].' AND (u.id=t.starter_id OR u.id=t.to_id)) WHERE t.id='.$tid) or error('Unable to fetch pms_new_topics info', __FILE__, __LINE__, $db->error());

if (!$db->num_rows($result))
	message($lang_common['Bad request']);

$cur_topic = $db->fetch_assoc($result);
$to_user = array();

if ($cur_topic['starter_id'] == $DBC_user['id'])
{
	$to_user['id'] = $cur_topic['to_id'];
	$to_user['username'] = $cur_topic['to_user'];

	if ($cur_topic['topic_st'] < 2)
	{
		$query_end = 'see_st='.time();
		$query_end2 = ', topic_st=0';
		$status = true;
	}
	else
		$status = false;
}
else
{
	$to_user['id'] = $cur_topic['starter_id'];
	$to_user['username'] = $cur_topic['starter'];

	if ($cur_topic['topic_to'] < 2)
	{
		$query_end = 'see_to='.time();
		$query_end2 = ', topic_to=0';
		$status = true;
	}
	else
		$status = false;
}

$newpost = false;
$quickpost = false;
if ($DBC_user['messages_enable'] == 1 && $DBC_user['g_pm'] == 1)
{
	if (($cur_topic['topic_st'] < 2 && $cur_topic['topic_to'] < 2) || ($DBC_user['id'] == $cur_topic['starter_id'] && $cur_topic['see_to'] == 0))
	{
		$pmsn_f_cnt = '<span><a href="pmsnew.php?mdl=post&amp;tid='.$tid.$sidamp.'">'.$lang_pmsn['Add Reply'].'</a></span>'.$pmsn_f_cnt;
		$newpost = true;

		if ($DBC_config['o_quickpost'] == '1' && $DBC_config['o_pms_min_kolvo'] <= $DBC_user['num_posts'])
			$quickpost = true;
		else
			$quickpost = false;
	}
	$pmsn_f_cnt = '<span><a href="pmsnew.php?mdl=del&amp;tid='.$tid.$sidamp.'">'.$lang_pmsn['Delete'].'</a></span>'.$pmsn_f_cnt;

	if ($mmodul == 'save' && $cur_topic['starter_id'] == $DBC_user['id'] && $cur_topic['see_to'] == 0)
		if ($DBC_user['g_pm_limit'] == 0 || $pmsn_kol_list < $DBC_user['g_pm_limit'])
			$pmsn_f_cnt = '<span><a href="pmsnew.php?mdl=send&amp;tid='.$tid.$sidamp.'">'.$lang_pmsn['Send d'].'</a></span>'.$pmsn_f_cnt;
}

if ($cur_topic['num_posts'] < $DBC_config['o_pms_min_kolvo'] && $cur_topic['userid'] > 1 && $cur_topic['topic_st'] < 2 && $cur_topic['topic_to'] < 2)
	$psmnwarn = "\t\t\t\t\t\t\t".'<div class="psmnwarn">'."\n\t\t\t\t\t\t\t\t".sprintf($lang_pmsn['Warn'], $DBC_config['o_pms_min_kolvo'])."\n\t\t\t\t\t\t\t".'</div>'."\n";
else
	$psmnwarn = '';

require DBC_ROOT.'language/'.$DBC_user['language'].'/topic.php';
require DBC_ROOT.'language/'.$DBC_user['language'].'/reputation.php';

// Determine the post offset (based on $_GET['p'])
$num_pages = ceil(($cur_topic['replies'] + 1) / $DBC_user['disp_posts']);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
$start_from = $DBC_user['disp_posts'] * ($p - 1);

// Generate paging links
$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'pmsnew.php?mdl=topic&amp;tid='.$tid.$sidamp);

if ($DBC_config['o_censoring'] == '1')
	$cur_topic['topic'] = censor_words($cur_topic['topic']);

define('DBC_ACTIVE_PAGE', 'pms_new');
require DBC_ROOT.'engine/engine.php';
?>




<?php

generate_pmsn_menu($pmsn_modul);

/*	<div class="blockform">
*/
?>
	<div class="block">






		<div class="pagepost_pm">
			<p class="pagelink conl"><span class="contacts"><?php echo $paging_links ?></span></p>
			<span class="contacts" style="margin-left: 7px;"><a href="index.php"><?php echo $lang_common['Index'] ?></a>
			<span>»&#160;</span><a href="pmsnew.php"><?php echo $lang_pmsn['PM'] ?></a>
			<span>»&#160;</span><a href="pmsnew.php?mdl=<?php echo $mmodul.$sidamp ?>"><?php echo $lang_pmsn[$mmodul].($sid ? $lang_pmsn['With'].$siduser : '') ?></a>
<?php
if (isset($to_user['id']) && $to_user['id'] != $sid)
{
?>
			<span>»&#160;</span><a href="pmsnew.php?mdl=<?php echo $mmodul.'&amp;sid='.$to_user['id'] ?>"><?php echo DBC_htmlspecialchars($to_user['username']) ?></a>

<?php
}
?>
			<span>»&#160;</span><?php echo DBC_htmlspecialchars($cur_topic['topic']) ?></span>
			<p class="postlink actions conr"><?php echo $pmsn_f_cnt ?></p>
		</div>
		<div class="clearer"></div>





<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_title_center"><span class="cat_title"><?php echo $lang_pmsn[$pmsn_modul].($sid ? $lang_pmsn['With'].$siduser : '') ?></span></td>
<td align="center" width="28" class="bg_forum_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></table>


<?php

require DBC_ROOT.'engine/parser.php';

$post_count = 0; // Keep track of post numbers

// Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
$result = $db->query('SELECT id FROM '.$db->prefix.'pms_new_posts WHERE topic_id='.$tid.' ORDER BY id LIMIT '.$start_from.','.$DBC_user['disp_posts']) or error('Unable to fetch pms_new_posts IDs', __FILE__, __LINE__, $db->error());

$post_ids = array();
for ($i = 0;$cur_post_id = $db->result($result, $i);$i++)
	$post_ids[] = $cur_post_id;

$post_view_new = array();

$result = $db->query('SELECT u.gender, u.email, u.title, u.url, u.location, u.signature, u.email_setting, u.num_posts, u.rep_plus AS count_rep_plus, u.rep_minus AS count_rep_minus, u.reputation_enable, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, p.post_seen, p.post_new, g.g_id, g.g_title, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'pms_new_posts AS p LEFT JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.id IN ('.implode(',', $post_ids).') ORDER BY p.id', true) or error('Unable to fetch pms_new_posts info', __FILE__, __LINE__, $db->error());
while ($cur_post = $db->fetch_assoc($result))
{
	$post_count++;
	$user_avatar = '';
	$user_info = array();
	$user_posts = array();
	$user_contacts = array();
	$post_actions = array();
	$is_online = '';
	$signature = '';

	if (!$cur_post['g_id'])
	{
		$cur_post['g_id'] = DBC_GUEST;
		$cur_post['gender'] = NULL;
	}

	// мод пола - Visman
	if ($cur_post['gender'] == 1)
		$cur_post['gender'] = 'male';
	else if ($cur_post['gender'] == 2)
		$cur_post['gender'] = 'female';
	else
		$cur_post['gender'] = NULL;


	if ($DBC_user['id'] != $cur_post['poster_id'])
	{
		if ($cur_post['post_new'] == 1)
			$post_view_new[] = $cur_post['id'];

		if ($cur_post['g_id'] != DBC_GUEST && $cur_post['g_id'] != DBC_ADMIN)
			$post_actions[] = '<li class="postreport"><span><a href="pmsnew.php?mdl=blocking&amp;uid='.$cur_post['poster_id'].'"><img src="engine/skins/images/report.png" align="absmiddle" alt=""/> '.$lang_pmsn['Block'].'</a></span></li>';
	}
	else if ($cur_post['post_new'] == 1)
	{
		if ($DBC_user['g_delete_posts'] == '1')
			$post_actions[] = '<li class="postdelete"><span><a href="pmsnew.php?mdl=del&amp;pid='.$cur_post['id'].$sidamp.'"><img src="engine/skins/images/comment_edit.png" align="absmiddle" alt=""/> '.$lang_topic['Delete'].'</a></span></li>';
		if ($DBC_user['g_edit_posts'] == '1')
			$post_actions[] = '<li class="postedit"><span><a href="pmsnew.php?mdl=edit&amp;pid='.$cur_post['id'].$sidamp.'"><img src="engine/skins/images/comment_edit.png" align="absmiddle" alt=""/> '.$lang_topic['Edit'].'</a></span></li>';
	}

	if ($newpost)
	{
		$post_actions[] = '<li class="postquote"><span><a href="pmsnew.php?mdl=post&amp;tid='.$tid.'&amp;qid='.$cur_post['id'].$sidamp.'"><img src="engine/skins/images/comment_add.png" align="absmiddle" alt=""/> '.$lang_topic['Reply'].'</a></span></li>';

		if ($quickpost)
				$post_actions[] = '<li class="postquote"><span id="pq'.$cur_post['id'].'"><a href="pmsnew.php?mdl=post&amp;tid='.$tid.'&amp;qid='.$cur_post['id'].$sidamp.'" onmousedown="get_quote_text()" onclick="Quote(\''.DBC_htmlspecialchars($cur_post['username']).'\','.$cur_post['id'].'); return false;"><img src="engine/skins/images/comment_add.png" align="absmiddle" alt=""/> '.$lang_topic['Quote'].'</a></span></li>';
//			$post_actions[] = '<li class="postquote"><span><a onmousedown="get_quote_text()" href="javascript:Quote(\''.DBC_htmlspecialchars($cur_post['username']).'\')">'.$lang_topic['QQuote'].'</a></span></li>';
	}

	if ($DBC_user['g_view_users'] == '1' && $cur_post['g_id'] != DBC_GUEST)
		$username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.DBC_htmlspecialchars($cur_post['username']).'</a>';
	else
		$username = DBC_htmlspecialchars($cur_post['username']);

	$user_title = get_title($cur_post);

	if ($DBC_config['o_censoring'] == '1')
		$user_title = censor_words($user_title);

	$user_title = colorize_group($cur_post['g_title'], $cur_post['g_id']);

	if ($cur_post['g_id'] == DBC_GUEST)
	{
		$is_online = '&nbsp;';
	}
	else
	{
		// Format the online indicator
		$is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<font color="blue">'.$lang_topic['Online'].'</font>' : '<font color="red">'.$lang_topic['Offline'].'</font>';

		if ($DBC_config['o_avatars'] == '1' && $DBC_user['show_avatars'] != '0')
		{
			if (isset($user_avatar_cache[$cur_post['poster_id']]))
				$user_avatar = $user_avatar_cache[$cur_post['poster_id']];
			else
				$user_avatar = $user_avatar_cache[$cur_post['poster_id']] = generate_avatar_markup($cur_post['poster_id']);
		}

		// We only show location, register date, post count and the contact links if "Show user info" is enabled
		if ($DBC_config['o_show_user_info'] == '1')
		{
			if ($cur_post['location'] != '')
			{
				if ($DBC_config['o_censoring'] == '1')
					$cur_post['location'] = censor_words($cur_post['location']);

				$user_info[] = '<li><span class="ft_detals">'.$lang_topic['From'].' '.DBC_htmlspecialchars($cur_post['location']).'</span></li>';
			}

			$user_info[] = '<li><span class="ft_detals">'.$lang_topic['Registered'].' '.format_time($cur_post['registered'], true).'</span></li>';

			if ($DBC_config['o_show_post_count'] == '1' || $DBC_user['is_admmod'])
				$user_posts[] = '<li><span class="ft_posts">'.$lang_topic['Posts'].'</span> <span class="fc_posts">'.forum_number_format($cur_post['num_posts']).'</span></li>';

			// Now let's deal with the contact links (Email and URL)
			if ($DBC_user['id'] != $cur_post['poster_id'])
			{
				if (($cur_post['email_setting'] == '0' || $DBC_user['is_admmod']) && $DBC_user['g_send_email'] == '1')
					$user_contacts[] = '<span class="email"><a href="mailto:'.$cur_post['email'].'">'.$lang_common['Email'].'</a></span>';
				else if ($cur_post['email_setting'] == '1' && $DBC_user['g_send_email'] == '1')
					$user_contacts[] = '<span class="email"><a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['Email'].'</a></span>';
			}

			if ($cur_post['url'] != '')
			{
				if ($DBC_config['o_censoring'] == '1')
						$cur_post['url'] = censor_words($cur_post['url']);

				$user_contacts[] = '<span class="website"><a href="'.DBC_htmlspecialchars($cur_post['url']).'">'.$lang_topic['Website'].'</a></span>';
			}
		}

		// Do signature parsing/caching
		if ($DBC_config['o_signatures'] == '1' && $cur_post['signature'] != '' && $DBC_user['show_sig'] != '0')
		{
			if (isset($signature_cache[$cur_post['poster_id']]))
				$signature = $signature_cache[$cur_post['poster_id']];
			else
			{
				$signature = parse_signature($cur_post['signature']);
				$signature_cache[$cur_post['poster_id']] = $signature;
			}
		}
	}

	// Perform the main parsing of the message (BBCode, smilies, censor words etc)
	$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);

?>


<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo ($post_count % 2 == 0) ? ' roweven' : ' rowodd' ?><?php if ($cur_post['id'] == $cur_topic['first_post_id']) echo ' firstpost'; ?><?php if ($post_count == 1) echo ' blockpost'; ?>">


<table border="0" cellpadding="0" cellspacing="0" width="100%"><thead><tr>
<td class="post_topic" align="center" width="217"><span <?php echo(($cur_post['gender'] != NULL) ? ' class="gender ' . $cur_post['gender'] . '"' : ''); ?>><span style="font-family: Tahoma;"><?php echo $username ?></span><a href="#req_message" onclick="return insert_text('', '[b]<?php echo DBC_htmlspecialchars($cur_post['username']) ?>[/b], ')">&nbsp;<img src="templates/Default/images/req_message.png" title="<?php echo $username_t ?>" border="0"></a></span></td>
<td class="post_topic" style="padding: 0px 5px 0px 5px; font-size: 11px;color: #1d83b8;" align="left">



<table border="0" cellpadding="0" cellspacing="0" width="100%"><thead><tr>
<td align="left" width="50%">


<?php echo format_time($cur_post['posted']) ?>


</td>
<td align="right" width="50%"><span class="conr"><?php echo $lang_topic['Post'] ?> #<?php echo ($start_from + $post_count) ?></span></td>
</tr></thead></table>


</td>
</tr></thead></table>






	<div class="box">
		<div class="inbox">
			<div class="postbody">
				<div class="postleft">






					<ul class="user_details">


<div class="author_info">

<ul class="user_details"><li class="avatar"><span class="avatar_post"><?php if ($user_avatar != '') echo "\t\t\t\t\t\t".''.$user_avatar.''."\n"; ?></span><br/><span title="<?php echo $user_rank ?>"><?php echo generate_rank_image($cur_post['num_posts']) ?></span></li></ul>
<ul class="user_fields">
<li style="background: #f7f7f7;"><span class="ft_group"><?php echo $lang_topic['Group'] ?></span><span class="fc_group"><?php echo $user_title ?></strong></span></li>
<li><span class="ft_status"><?php echo $lang_topic['Status'] ?></span><span class="fc_status"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></span></li>
<li style="background: #f7f7f7;"><?php require(DBC_ROOT.'engine/reputation/rep_viewtopic.php'); ?></li>
<?php if (count($user_posts)) echo "\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $user_posts)."\n"; ?>
<li style="background: #f7f7f7;"><span class="ft_more"><a title="<?php echo $lang_topic['More'] ?>" href="javascript:ShowOrHide('Profile_detals<?php echo ($start_from + $post_count) ?>');"><?php echo $lang_topic['More'] ?></a></span><span class="fc_more"><a title="<?php echo $lang_topic['More'] ?>" href="javascript:ShowOrHide('Profile_detals<?php echo ($start_from + $post_count) ?>');"><img src="templates/Default/images/more_img.png" alt="" border="0"  /></a></span></li>

</ul>

                              <div id="Profile_detals<?php echo ($start_from + $post_count) ?>" align="center" style="display: none;">
                              <ul class="reset_profile">
				<?php if (count($user_info)) echo "\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $user_info)."\n"; ?>
                              </ul>
                              </div>


</div>
<center><div style="margin-bottom: 7px;"><?php if (count($user_contacts)) echo "\t\t\t\t\t\t".'<span class="contacts_profile" align="center">'.''.implode(' ', $user_contacts).'</span>'.''."\n"; ?></div></center>
</ul>
</div>



				<div class="postright">
					<h3><?php if ($cur_post['id'] != $cur_topic['first_post_id']) echo $lang_topic['Re'].' '; ?><?php echo DBC_htmlspecialchars($cur_topic['subject']) ?></h3>
					<div class="postmsg" id="post<? echo $cur_post['id'] ?>">
						<?php echo $cur_post['message']."\n" ?>
<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.DBC_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
					</div>
<?php if (!is_null($cur_post['warning'])): ?>
					<div class="postwarn">
						<?php echo $cur_post['warning']."\n" ?>
					</div>
<?php endif; ?>
<?php if ($signature != '') echo "\t\t\t\t\t".'<div class="postsignature postmsg"><hr />'.$signature.'</div>'."\n"; ?>
				</div>
			</div>
		</div>
		<div class="inbox">
			<div class="postfoot clearb">
<?php if (count($post_actions)) echo "\t\t\t\t".'<div class="postfootright">'."\n\t\t\t\t\t".'<ul class="post_controls"><li id="info'.$cur_post['id'].'" style="display:none">'.$lang_ape['Loading'].'</li>'."\n\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $post_actions)."\n\t\t\t\t\t".'</ul>'."\n\t\t\t\t".'</div>'."\n" ?>
			</div>
		</div>
	</div>
</div>


<?php

}  // while

?>

<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="30" class="bg_forum_bott_left"><img src="templates/Default/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_bott_center"><img src="templates/Default/images/spacer.gif" border="0"></td>
<td align="center" width="30" class="bg_forum_bott_right"><img src="templates/Default/images/spacer.gif" border="0"></td>
</tr></thead></table>




		<div class="pagepost">
<p class="pagelink conl"><span class="contacts"><?php echo $paging_links ?></span></p>

			<p class="postlink actions conr"><?php echo $pmsn_f_cnt ?></p>
		</div>
	</div>
<?php

if ($status)
{
	if (count($post_view_new) > 0 )
	{
		$db->query('UPDATE '.$db->prefix.'pms_new_posts SET post_seen=1, post_new=0 WHERE id IN ('.implode(',', $post_view_new).')') or error('Unable to update pms_new_posts', __FILE__, __LINE__, $db->error());

		$result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'pms_new_posts WHERE poster_id!='.$DBC_user['id'].' AND topic_id='.$tid.' AND post_new=1') or error('Unable to fetch pms_new_posts info', __FILE__, __LINE__, $db->error());
		$first_new_post_id = $db->result($result);
		if (!$first_new_post_id)
		$query_end .= $query_end2;
	}

	$db->query('UPDATE '.$db->prefix.'pms_new_topics SET '.$query_end.' WHERE id='.$tid) or error('Unable to update pms_new_topics', __FILE__, __LINE__, $db->error());

	if (count($post_view_new) > 0 )
		pmsn_user_update($DBC_user['id']);
}

// Display quick post if enabled
if ($quickpost)
{
	$cur_index = 1;

?>







<script type="text/javascript">
function showbb_info() {
$(function(){
	$('#bb_info').dialog({
		autoOpen: true,
		show: 'fade',
		hide: 'fade',
		 width: 230,
		height: 150,
                buttons: {
		"<?php echo $lang_topic['Close'] ?>" : function() {
                $(this).dialog("close");
            }
               }
	});
});
}
</script>
<div id="bb_info" title="BB Codes info" style="display: none;">
		<span style="text-align: left;">
		<span><a href="help.php#bbcode" onclick="window.open(this.href); return false;" class="bbhelp"><?php echo $lang_common['BBCode'] ?></a> <?php echo ($DBC_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span>
		<p><span><a href="help.php#img" onclick="window.open(this.href); return false;" class="bbhelp"><?php echo $lang_common['img tag'] ?></a> <?php echo ($DBC_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></p>
		<p><span><a href="help.php#smilies" onclick="window.open(this.href); return false;" class="bbhelp"><?php echo $lang_common['Smilies'] ?></a> <?php echo ($DBC_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></p>
		</span>
		<ul class="bblinks" style="list-style: none;padding: 0px;"></ul>
</div>


	<div id="quickpost" class="blockform">


<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_title_center"><span class="cat_title"><?php echo $lang_topic['Quick post'] ?></span></td>
<td align="center" width="28" class="bg_forum_title_right"><a href='javascript:someFunction()' onclick="showbb_info();" style="color: #ffffff;">[?]</a></td>



</tr></table>

<table class="forum_adv_table"  width="100%" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" class="forum_adv_tleft" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" width="100%"><div class="forum_adv">
<div id="quickpost">


			<form id="quickpostform" method="post" action="pmsnew.php?mdl=post&amp;tid=<?php echo $tid.$sidamp ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
			<div class="inform">

						<input type="hidden" name="csrf_hash" value="<?php echo $pmsn_csrf_hash ?>" />

<div class="infldset">
<table width="100%" border="0">
<tr>
<td width="150" align="center" valign="top"><div class="post_avatar"><?php echo generate_avatar_markup($DBC_user['id']) ?></div>
<a href="user_<?php echo $DBC_user['id'] ?>"><span style="font-family: Verdana;"><?php echo DBC_htmlspecialchars($DBC_user['username']) ?></span></a><br/>

</td>
<td><div id="bbcode_bar"></div>

						<textarea class="input_text" name="req_message" id="req_message" rows="7" cols="75" width="100%" style="width: 98%" tabindex="<?php echo $cur_index++ ?>" onclick="setNewField(this.name, document.getElementById( 'quickpostform' ))"></textarea>
</td></tr></table>
</div>


			<p class="buttons">
				<p class="buttons"><input class="fbutton" type="submit" name="submit" tabindex="<?php echo $cur_index++ ?>" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /> <input class="fbutton" type="submit" name="preview" tabindex="<?php echo $cur_index++ ?>" value="<?php echo $lang_common['Preview'] ?>" accesskey="p" /></p>
			</p>
			</div>
		</form>
	</div>


<br/>
</div></td>
<td align="left" class="forum_adv_tright" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
</td></tr></table>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="30" class="bg_forum_bott_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_bott_center"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="center" width="30" class="bg_forum_bott_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></thead></table>








	</div>





















<?php
require DBC_ROOT.'engine/bbcode.inc.php';

}

